﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MX.Core.Assets
{

    /// <summary>
    /// 图片上传返回结果
    /// </summary>
    public enum ReponseCode : int
    {
        /// <summary>
        /// 操作成功
        /// </summary>
        SUCCESSED = 200,
        /// <summary>
        /// 站点不存在
        /// </summary>
        SITE_NOT_EXISTS = 404,
        /// <summary>
        /// 服务器内部错误
        /// </summary>
        SERVER_ERROR = 500,
        /// <summary>
        /// 未允许上传
        /// </summary>
        Not_Allow_Upload = 405,
        /// <summary>
        /// 未授权访问
        /// </summary>
        Permission_Denied = 401,
        ClientError = 500
    }

    public class UploadResponse
    {
        public ReponseCode code { get; set; }

        public string url { get; set; }

        public override string ToString()
        {
            return code + ":" + url;
        }
    }
}
